import { Navigate } from "react-router-dom";
import Index from "../pages/Index";
import Login from "../pages/login/Login";
import Home from "../pages/home/Home";
import Classify from "../pages/Inventory/Classify";
import Message from "../pages/Inventory/Message";
import Allot from "../pages/warehouse/Allot";
import Check from "../pages/warehouse/Check";
import GoStorage from "../pages/warehouse/GoStorage";
import ToStorage from "../pages/warehouse/ToStorage";
import Client from "../pages/unit/Client";
import Supplier from "../pages/unit/Supplier";
import Store from "../pages/store/Store";
import Institution from "../pages/organization/Institution";
import Post from "../pages/organization/Post";
import Role from "../pages/organization/Role";
import User from "../pages/organization/User";

const router = [
  {
    path: "/",
    element: <Navigate to={"/login"}></Navigate>,
  },
  {
    path: "/login",
    element: <Login />,
  },
  {
    path: "/index",
    element: <Index />,
    children: [
      {
        path: "/index/home",
        element: <Home />,
      },
      {
        path: "/index/inventory",
        children: [
          {
            path: "/index/inventory/message",
            element: <Message />,
          },
          {
            path: "/index/inventory/classify",
            element: <Classify />,
          },
        ],
      },
      {
        path: "/index/warehouse",
        children: [
          {
            path: "/index/warehouse/allot",
            element: <Allot />,
          },
          {
            path: "/index/warehouse/check",
            element: <Check />,
          },
          {
            path: "/index/warehouse/goStorage",
            element: <GoStorage />,
          },
          {
            path: "/index/warehouse/toStorage",
            element: <ToStorage />,
          },
        ],
      },
      {
        path: "/index/unit",
        children: [
          {
            path: "/index/unit/client",
            element: <Client />,
          },
          {
            path: "/index/unit/supplier",
            element: <Supplier />,
          },
        ],
      },
      {
        path: "/index/store/store",
        element: <Store />,
      },
      {
        path: "/index/organization",
        children: [
          {
            path: "/index/organization/institution",
            element: <Institution />,
          },
          {
            path: "/index/organization/post",
            element: <Post />,
          },
          {
            path: "/index/organization/user",
            element: <User />,
          },
          {
            path: "/index/organization/role",
            element: <Role />,
          },
        ],
      },
    ],
  },
];

export default router;
